var express = require('express');
var AdminRouter = express.Router();
let message = require("../request_process/message");
let adminProcess =require('../request_process/adminProcess');
let code_message = require("../request_process/JsonFileOprate")
AdminRouter
    .post('/*', (req,res,next)=>{
    if(req.session.adminid) {
        next();
    }
    else{
        res.json(new  message(449,null,code_message['449']))
    }
})
    .post('/catAdminAccount',adminProcess.catAdminAccount)
    .post('/modifyAdminAccount',adminProcess.modifyAdminAccount)
    .post('/appendMission',adminProcess.appendMission)
    .post('/removeMission',adminProcess.removeMission)
    .post('/cancelAssignedMission',adminProcess.cancelAssignedMission)
    .post('/assignMission',adminProcess.assignMission)
    .post('/selectTodayAllMission',adminProcess.selectTodayAllMission)
    .post('/selectTomorrowAllMission',adminProcess.selectTomorrowAllMission)
    .post('/selectAllStaff',adminProcess.selectAllStaff)
    .post('/selectAllMission',adminProcess.selectAllMission)
    .post('/selectAssignedMission',adminProcess.selectAssignedMission)
    .post('/selectUnAssignedMission',adminProcess.selectUnAssignedMission)
module.exports=AdminRouter

